/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entitybean;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author ShahanThai
 */
@Entity
@Table(name = "Albums", catalog = "SharingMusic", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Albums.findAll", query = "SELECT a FROM Albums a"),
    @NamedQuery(name = "Albums.findByAlbumID", query = "SELECT a FROM Albums a WHERE a.albumID = :albumID"),
    @NamedQuery(name = "Albums.findByAlbumName", query = "SELECT a FROM Albums a WHERE a.albumName = :albumName")})
public class Albums implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue
    @Basic(optional = false)
    @Column(name = "AlbumID", nullable = false)
    private int albumID;
    @Basic(optional = false)
    @Column(name = "AlbumName", nullable = false, length = 100)
    private String albumName;
    @Lob
    @Column(name = "ImageUrl", length = 2147483647)
    private String imageUrl;
    @OneToMany(mappedBy = "albums")
    private List<Songs> songsList;

    public Albums() {
    }

    public Albums(int albumID) {
        this.albumID = albumID;
    }

    public Albums(int albumID, String albumName) {
        this.albumID = albumID;
        this.albumName = albumName;
    }

    public Albums(String albumName, String imageUrl) {
        this.albumName = albumName;
        this.imageUrl = imageUrl;
    }

    public Integer getAlbumID() {
        return albumID;
    }

    public void setAlbumID(int albumID) {
        this.albumID = albumID;
    }

    public String getAlbumName() {
        return albumName;
    }

    public void setAlbumName(String albumName) {
        this.albumName = albumName;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public List<Songs> getSongsList() {
        return songsList;
    }

    public void setSongsList(List<Songs> songsList) {
        this.songsList = songsList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash = albumID;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Albums)) {
            return false;
        }
        Albums other = (Albums) object;
        if (this.albumID != other.albumID) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitybean.Albums[albumID=" + albumID + "]";
    }

}
